<template>
  <view class="page">
    <!-- 状态栏占位 -->
    <view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
    
    <!-- 自定义导航栏 -->
    <view class="custom-navbar">
      <view class="navbar-content">
        <view class="app-icon">
          <image class="app-logo" src="/static/logo-tu@2x.png" mode="aspectFill" />
        </view>
        <view class="app-title">练习</view>
      </view>
    </view>

    <!-- 练习内容区域 -->
    <view class="training-content">
      <view class="feature-card">
        <view class="card-header">
          <image class="feature-icon" src="/static/notebook-icon.png" mode="aspectFit" />
          <text class="card-title">个性化练习</text>
        </view>
        <text class="card-desc">根据学习情况推荐练习题目</text>
        <button class="card-btn" @tap="goToPersonalizedTraining">开始练习</button>
      </view>

      <view class="feature-card">
        <view class="card-header">
          <image class="feature-icon" src="/static/paperCenter-icon.png" mode="aspectFit" />
          <text class="card-title">专项训练</text>
        </view>
        <text class="card-desc">针对薄弱知识点进行专项练习</text>
        <button class="card-btn" @tap="goToSpecialTraining">开始训练</button>
      </view>

      <view class="feature-card">
        <view class="card-header">
          <image class="feature-icon" src="/static/photo-icon.png" mode="aspectFit" />
          <text class="card-title">模拟考试</text>
        </view>
        <text class="card-desc">真实考试环境模拟练习</text>
        <button class="card-btn" @tap="goToMockExam">开始考试</button>
      </view>
    </view>
  </view>
</template>

<script setup>
import { ref, onMounted } from 'vue'

// 系统信息
const statusBarHeight = ref(0)

// 练习功能
const goToPersonalizedTraining = () => {
  uni.showToast({
    title: '个性化练习',
    icon: 'none'
  })
}

const goToSpecialTraining = () => {
  uni.showToast({
    title: '专项训练',
    icon: 'none'
  })
}

const goToMockExam = () => {
  uni.showToast({
    title: '模拟考试',
    icon: 'none'
  })
}

onMounted(() => {
  // 获取系统信息
  const systemInfo = uni.getSystemInfoSync()
  statusBarHeight.value = systemInfo.statusBarHeight || 0
})
</script>

<style scoped lang="scss">
.page {
  min-height: 100vh;
  background: 
    linear-gradient(180deg, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0.8) 20%, rgba(255,255,255,1) 100%),
    linear-gradient(270deg, #ACFB97 0%, rgba(52,207,185,0) 100%),
    linear-gradient(270deg, rgba(95,141,227,0) 0%, #00C9FF 100%),
    linear-gradient(114deg, #F0FFFD 0%, #FCFCFD 100%);
  position: relative;
}

.status-bar {
  width: 100%;
}

.custom-navbar {
  height: 88rpx;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32rpx 64rpx;
  position: relative;
}

.navbar-content {
  display: flex;
  align-items: center;
  font-family: FontName, FontName;
  font-weight: 400;
  font-size: 56rpx;
  color: #191E31;
  line-height: 64rpx;
  text-align: center;
  font-style: normal;
  text-transform: none;
}

.app-icon {
  width: 64rpx;
  height: 64rpx;
  background: rgba(255,255,255,1);
  border-radius: 36rpx;
  border: 2rpx solid #FFFFFF;
  margin-right: 16rpx;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-logo {
  width: 48rpx;
  height: 48rpx;
  border-radius: 24rpx;
}

.app-title {
  font-family: 腾讯体, 腾讯体;
  font-weight: 400;
  font-size: 56rpx;
  color: #191E31;
  line-height: 56rpx;
  text-align: center;
  font-style: normal;
  text-transform: none;
}

.training-content {
  padding: 0 24rpx;
  display: flex;
  flex-direction: column;
  gap: 24rpx;
}

.feature-card {
  background: linear-gradient(114deg, #F0FFFD 0%, #FCFCFD 100%);
  border-radius: 24rpx;
  padding: 32rpx;
  box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(47,71,71,0.05);
  border: 4rpx solid #FFFFFF;
}

.card-header {
  display: flex;
  align-items: center;
  margin-bottom: 16rpx;
}

.feature-icon {
  width: 48rpx;
  height: 48rpx;
  margin-right: 16rpx;
}

.card-title {
  font-family: MiSans, MiSans;
  font-weight: 600;
  font-size: 32rpx;
  color: #191E31;
  line-height: 48rpx;
}

.card-desc {
  font-family: PingFang SC, PingFang SC;
  font-weight: 400;
  font-size: 24rpx;
  color: #68708A;
  line-height: 32rpx;
  margin-bottom: 24rpx;
  display: block;
}

.card-btn {
  width: 100%;
  height: 88rpx;
  background: linear-gradient(90deg, #00A46C 0%, #01D18B 100%);
  border-radius: 12rpx;
  color: #FFFFFF;
  font-family: MiSans, MiSans;
  font-weight: 500;
  font-size: 28rpx;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
</style>
